package cn.edu.nankai.bookstore.service.impl;

import cn.edu.nankai.bookstore.dao.BookDao;
import cn.edu.nankai.bookstore.dao.impi.BookDaoImpl;
import cn.edu.nankai.bookstore.domain.po.Book;
import cn.edu.nankai.bookstore.service.BookService;

import java.util.List;

public class BookServiceImpl implements BookService {
    private BookDao bookDao = new BookDaoImpl();
    public int add(Book book){
        return bookDao.insert(book);
    }
    public boolean remove(int id){
        return bookDao.delete(id) != 0;
    }
    public List<Book> getAll(){
        return bookDao.findAll();
    }
    public Book getById(int id){
        return bookDao.findById(id);
    }
}
